home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / include / scribus-ng / scribusdoc.h < prev    next >
Encoding:
C/C++ Source or Header  |  2009-12-12  |  43.3 KB  |  1,221 lines

  1. /*
  2. For general Scribus (>=1.3.2) copyright and licensing information please refer
  3. to the COPYING file provided with the program. Following this notice may exist
  4. a copyright and/or license notice that predates the release of Scribus 1.3.2
  5. for which a new license (GPL+exception) is in place.
  6. */
  7. /***************************************************************************
  8.                           scribusdoc.h  -  description
  9.                              -------------------
  10.     begin                : Fre Apr  6 21:47:55 CEST 2001
  11.     copyright            : (C) 2001 by Franz Schmid
  12.     email                : Franz.Schmid@altmuehlnet.de
  13.  ***************************************************************************/
  14.  
  15. /***************************************************************************
  16.  *                                                                         *
  17.  *   This program is free software; you can redistribute it and/or modify  *
  18.  *   it under the terms of the GNU General Public License as published by  *
  19.  *   the Free Software Foundation; either version 2 of the License, or     *
  20.  *   (at your option) any later version.                                   *
  21.  *                                                                         *
  22.  ***************************************************************************/
  23. #ifndef SCRIBUSDOC_H
  24. #define SCRIBUSDOC_H
  25. #ifdef HAVE_CONFIG_H
  26. #include "scconfig.h"
  27. #endif
  28. // include files for QT
  29. #include <QColor>
  30. #include <QFont>
  31. #include <QList>
  32. #include <QMap>
  33. #include <QObject>
  34. #include <QPixmap>
  35. #include <QRectF>
  36. #include <QStringList>
  37. #include <QTimer>
  38.  
  39.  
  40. #include "gtgettext.h" //CB For the ImportSetup struct and itemadduserframe
  41. #include "scribusapi.h"
  42. #include "observable.h"
  43. #include "prefsstructs.h"
  44. #include "documentinformation.h"
  45. #include "undoobject.h"
  46. #include "page.h"
  47. #include "pageitem.h"
  48. #include "pagestructs.h"
  49. #include "usertaskstructs.h"
  50. #include "styles/styleset.h"
  51. #include "scguardedptr.h"
  52. #include "updatemanager.h"
  53. #include "sclayer.h"
  54.  
  55. #include CMS_INC
  56.  
  57. #include <ft2build.h>
  58. #include FT_FREETYPE_H
  59.  
  60. class DocUpdater;
  61. class UndoManager;
  62. class UndoState;
  63. class PDFOptions;
  64. class Hyphenator;
  65. class Selection;
  66. class ScribusView;
  67. class ScribusMainWindow;
  68. class ResourceCollection;
  69. class PageSize;
  70. class ScPattern;
  71. class UndoTransaction;
  72.  
  73. class QProgressBar;
  74.  
  75. struct SCRIBUS_API NodeEditContext : public MassObservable<QPointF>
  76. {
  77.     enum SubMode { MOVE_POINT = 0, ADD_POINT = 1, DEL_POINT = 2, SPLIT_PATH = 3 };
  78.     int submode;
  79.     bool isContourLine;
  80.     FPointArray *oldClip;
  81.     UndoTransaction* nodeTransaction;
  82.     double oldItemX;
  83.     double oldItemY;
  84.         
  85.     int ClRe;
  86.     int ClRe2;
  87.     int SegP1;
  88.     int SegP2;
  89.     bool EdPoints;
  90.     bool MoveSym;
  91.     QList<int> SelNode;    
  92.     
  93.     NodeEditContext();
  94.     
  95.     bool hasNodeSelected();
  96.     void deselect();
  97.     
  98.     void reset();
  99.     
  100.     void reset1Control(PageItem* currItem);
  101.     void resetControl(PageItem* currItem);
  102.     FPointArray beginTransaction(PageItem* currItem);
  103.     void finishTransaction(PageItem* currItem);
  104.     ItemState<QPair<FPointArray, FPointArray> >* finishTransaction1(PageItem* currItem);
  105.     void finishTransaction2(PageItem* currItem, ItemState<QPair<FPointArray, FPointArray> >* state);
  106.     void moveClipPoint(PageItem *currItem, FPoint ip);
  107. };
  108.  
  109.  
  110. /**! \brief the Document Class
  111.   */
  112. class SCRIBUS_API ScribusDoc : public QObject, public UndoObject, public Observable<ScribusDoc>
  113. {
  114.     Q_OBJECT
  115.  
  116. public:
  117.     ScribusDoc();
  118.     ScribusDoc(const QString& docName, int unitIndex, const PageSize& pagesize, const MarginStruct& margins, const DocPagesSetup& pagesSetup);
  119.     ~ScribusDoc();
  120.     void init();
  121.     void setup(const int, const int, const int, const int, const int, const QString&, const QString&);
  122.     void setLoading(const bool);
  123.     bool isLoading() const;
  124.     void setModified(const bool);
  125.     bool isModified() const;
  126. /** Setzt die Seitenattribute */
  127.     void setPage(double b, double h, double t, double l, double r, double bo, double sp, double ab, bool atf, int fp);
  128.     void resetPage(MarginStruct& newMargins, int fp);
  129.  
  130.     /**
  131.      * @brief Return the view associated with the document
  132.      */
  133.     ScribusView* view() const;
  134.     ScribusMainWindow* scMW() const {return m_ScMW;}
  135.     void setGUI(bool hasgui, ScribusMainWindow* mw, ScribusView* view);
  136.  
  137.     /**
  138.      * @brief Return the guarded object associated with the document
  139.      */
  140.     const ScGuardedPtr<ScribusDoc>& guardedPtr() const;
  141.     
  142.     UpdateManager* updateManager() { return &m_updateManager; }
  143.     MassObservable<PageItem*> * itemsChanged() { return &m_itemsChanged; }
  144.     MassObservable<Page*>     * pagesChanged() { return &m_pagesChanged; }
  145.     MassObservable<QRectF>    * regionsChanged() { return &m_regionsChanged; }
  146.     void invalidateRegion(QRectF region);
  147.     
  148.     // Add, delete and move pages
  149.     
  150.     Page* addPage(const int pageNumber, const QString& masterPageName=QString::null, const bool addAutoFrame=false);
  151.     void deletePage(const int);
  152.     //! @brief Add a master page with this function, do not use addPage
  153.     Page* addMasterPage(const int, const QString&);
  154.     void deleteMasterPage(const int);
  155.     //! @brief Rebuild master name list
  156.     void rebuildMasterNames(void);
  157.     //! @brief Replace a master page by default one
  158.     void replaceMasterPage(const QString& oldMasterPage);
  159.     //! @brief Rename a master page
  160.     bool renameMasterPage(const QString& oldPageName, const QString& newPageName);
  161.     //! @brief Create the default master pages based on the layout selected by the user, ie, Normal, Normal Left, etc.
  162.     void createDefaultMasterPages();
  163.     //! @brief Create the requested pages in a new document, run after createDefaultMasterPages()
  164.     void createNewDocPages(int pageCount);
  165.     /**
  166.      * @brief Add the automatic text frame to the page
  167.      * @param pageNumber page number
  168.      * @return number of frame
  169.      */
  170.     int addAutomaticTextFrame(const int pageNumber);
  171.     /**
  172.      * Set the left and right margins based on the location of the page
  173.      * @param pageIndex 
  174.      */
  175.     void setLocationBasedPageLRMargins(uint pageIndex);
  176.     /**
  177.      * @brief Move page(s) within the document
  178.      * @param from page index
  179.      * @param to page index
  180.      * @param ziel target to move to (page index)
  181.      * @param art Before, After or at the end
  182.      */
  183.     void movePage(const int from, const int to, const int ziel, const int art);
  184.     
  185.     /**
  186.      * @brief Copy a page (pageNumberToCopy) copyCount times, whereToInsert(before or after) the existingPage or at the end.
  187.      * @param pageNumberToCopy 
  188.      * @param existingPage 
  189.      * @param whereToInsert 
  190.      * @param copyCount 
  191.      */
  192.     void copyPage(int pageNumberToCopy, int existingPage, int whereToInsert, int copyCount);
  193.     
  194.     // Add, delete and move layers
  195.     /**
  196.      * @brief Add a layer to the current document
  197.      * @param layerName name of layer
  198.      * @param activate the layer active
  199.      * @return Number of the layer created
  200.      */
  201.     int addLayer(const QString& layerName=QString::null, const bool activate=false);
  202.     /**
  203.      * @brief Copies a layer from the current document
  204.      * @param layerNumberToCopy source layer
  205.      * @param whereToInsert target layer
  206.      * @return Success or failure
  207.      */
  208.     void copyLayer(int layerNumberToCopy, int whereToInsert);
  209.     /**
  210.      * @brief Delete a layer from the current document
  211.      * @param layerNumber of layer
  212.      * @param deleteItems the items on the layer too?
  213.      * @return Success or failure
  214.      */
  215.     bool deleteLayer(const int layerNumber, const bool deleteItems);
  216.     /**
  217.      * @brief Return the number of the current layer
  218.      * @return Active layer number
  219.      */
  220.     int activeLayer();
  221.  
  222.     /**
  223.      * @brief Return the name of the current layer
  224.      * @return Name of the layer
  225.      */
  226.     const QString& activeLayerName();
  227.     /**
  228.      * @brief Set the active layer via the layer number
  229.      * @param layerToActivate Number of the layer
  230.      * @return Success or failure
  231.      */
  232.     bool setActiveLayer(const int layerToActivate);
  233.     /**
  234.      * @brief Set the active layer via the layer name
  235.      * @param layerNameToActivate Name of the layer
  236.      * @return Success or failure
  237.      */
  238.     bool setActiveLayer(const QString & layerNameToActivate);
  239.     /**
  240.      * @brief Set the layer printable via the layer number
  241.      * @param layerNumber Number of the layer
  242.      * @param isPrintable bool true = layer is prantable
  243.      * @return Success or failure
  244.      */
  245.     bool setLayerPrintable(const int layerNumber, const bool isPrintable);
  246.     /**
  247.      * @brief Is the layer printable
  248.      * @param layerNumber Number of the layer
  249.      * @return Printable or not
  250.      */
  251.     bool layerPrintable(const int layerNumber);
  252.     /**
  253.      * @brief Set the layer visible via the layer number
  254.      * @param layerNumber Number of the layer
  255.      * @param isViewable true = layer is visible
  256.      * @return Success or failure
  257.      */
  258.     bool setLayerVisible(const int layerNumber, const bool isViewable);
  259.     /**
  260.      * @brief Is the layer visible
  261.      * @param layerNumber Number of the layer
  262.      * @return Visible or not
  263.      */
  264.     bool layerVisible(const int layerNumber);
  265.     /**
  266.      * @brief Set the layer locked via the layer number
  267.      * @param layerNumber Number of the layer
  268.      * @param isLocked true = layer is locked
  269.      * @return Success or failure
  270.      */
  271.     bool setLayerLocked(const int layerNumber, const bool isLocked);
  272.     /**
  273.      * @brief Is the layer locked
  274.      * @param layerNumber Number of the layer
  275.      * @return Locked or not
  276.      */
  277.     bool layerLocked(const int layerNumber);
  278.     /**
  279.      * @brief Set the layer flow via the layer number
  280.      * @param layerNumber Number of the layer
  281.      * @param flow true = Text flows around objects on this layer
  282.      * @return Success or failure
  283.      */
  284.     bool setLayerFlow(const int layerNumber, const bool flow);
  285.     /**
  286.      * @brief does text flow around objects on this layer
  287.      * @param layerNumber Number of the layer
  288.      * @return flow or not
  289.      */
  290.     bool layerFlow(const int layerNumber);
  291.     /**
  292.      * @brief Set the layer transparency via the layer number
  293.      * @param layerNumber Number of the layer
  294.      * @param trans transparency value 0.0 - 1.0
  295.      * @return Success or failure
  296.      */
  297.     bool setLayerTransparency(const int layerNumber, double trans);
  298.     /**
  299.      * @brief returns the layer transparency
  300.      * @param layerNumber Number of the layer
  301.      * @return transparency value 0.0 - 1.0
  302.      */
  303.     double layerTransparency(const int layerNumber);
  304.     /**
  305.      * @brief Set the layer layerBlendMode via the layer number
  306.      * @param layerNumber Number of the layer
  307.      * @param blend layerBlendMode
  308.      * @return Success or failure
  309.      */
  310.     bool setLayerBlendMode(const int layerNumber, int blend);
  311.     /**
  312.      * @brief returns the layer BlendMode
  313.      * @param layerNumber Number of the layer
  314.      * @return layerBlendMode
  315.      */
  316.     int layerBlendMode(const int layerNumber);
  317.     /**
  318.      * @brief Return the level of the requested layer
  319.      * @param layerNumber Number of the layer
  320.      * @return Level of the layer
  321.      */
  322.     int layerLevelFromNumber(const int layerNumber);
  323.     /**
  324.      * @brief Set the layer marker color
  325.      * @param layerNumber Number of the layer
  326.      * @param color color of the marker
  327.      * @return Success or failure
  328.      */
  329.     bool setLayerMarker(const int layerNumber, QColor color);
  330.     /**
  331.      * @brief returns the layer marker color
  332.      * @param layerNumber Number of the layer
  333.      * @return marker color
  334.      */
  335.     QColor layerMarker(const int layerNumber);
  336.     /**
  337.      * @brief Set the layer outline mode via the layer number
  338.      * @param layerNumber Number of the layer
  339.      * @param outline true = layer is displayed in outlines only
  340.      * @return Success or failure
  341.      */
  342.     bool setLayerOutline(const int layerNumber, const bool outline);
  343.     /**
  344.      * @brief is this layer in outline mode
  345.      * @param layerNumber Number of the layer
  346.      * @return outline or not
  347.      */
  348.     bool layerOutline(const int layerNumber);
  349.     /**
  350.      * @brief Return the number of the layer at a certain level
  351.      * @param layerLevel Layer level
  352.      * @return Layer number
  353.      */
  354.     int layerNumberFromLevel(const int layerLevel);
  355.     /**
  356.      * @brief Return the layer count
  357.      * @return Number of layers in doc
  358.      */
  359.     int layerCount() const;
  360.     /**
  361.      * @brief Lower a layer
  362.      * @param layerNumber Number of the layer
  363.      * @return Success or failure
  364.      */
  365.     bool lowerLayer(const int layerNumber);
  366.     /**
  367.      * @brief Lower a layer using the level
  368.      * @param layerLevel Level of the layer
  369.      * @return Success or failure
  370.      */
  371.     bool lowerLayerByLevel(const int layerLevel);
  372.     /**
  373.      * @brief Raise a layer
  374.      * @param layerNumber Number of the layer
  375.      * @return Success or failure
  376.      */
  377.     bool raiseLayer(const int layerNumber);
  378.     /**
  379.      * @brief Raise a layer using the level
  380.      * @param layerLevel Level of the layer
  381.      * @return Success or failure
  382.      */
  383.     bool raiseLayerByLevel(const int layerLevel);
  384.     /**
  385.      * @brief Return the layer name
  386.      * @param layerNumber Number of the layer
  387.      * @return Name of the layer
  388.      */
  389.     QString layerName(const int layerNumber) const;
  390.     /**
  391.      * @brief Change the name of a layer
  392.      * @param layerNumber number of the layer
  393.      * @param newName new name of the layer
  394.      * @return Success or failure
  395.      */
  396.     bool changeLayerName(const int layerNumber, const QString& newName);
  397.     /**
  398.      * @brief Does the layer have items on it?
  399.      * @param layerNumber Number of the layer
  400.      * @return Layer contains items bool
  401.      */
  402.     bool layerContainsItems(const int layerNumber);
  403.     /**
  404.      * @brief Renumber a layer. Used in particular for reinsertion for undo/redo
  405.      * @param layerNumber old layer number
  406.      * @param newLayerNumber New layer number
  407.      * @return Success or failure
  408.      */
  409.     bool renumberLayer(const int layerNumber, const int newLayerNumber);
  410.     /**
  411.      * @brief Return a list of the layers in their order
  412.      * @param list QStringList to insert the layer names into
  413.      */
  414.     void orderedLayerList(QStringList* list);
  415.     //Items
  416.     bool deleteTaggedItems();
  417.  
  418.     /*!
  419.         * @brief Builds a qmap of the icc profiles used within the document
  420.      */
  421.     void getUsedProfiles(ProfilesL& usedProfiles);
  422.     bool OpenCMSProfiles(ProfilesL InPo, ProfilesL InPoCMYK, ProfilesL MoPo, ProfilesL PrPo);
  423.     void CloseCMSProfiles();
  424.     void SetDefaultCMSParams();
  425.     /**
  426.      * @brief Switch Colormanagement on or of
  427.      * @param enable bool, if true Colormanagement is switched on, else off
  428.      */
  429.     void enableCMS(bool enable);
  430.     
  431.     const ParagraphStyle& paragraphStyle(QString name) { return docParagraphStyles.get(name); }
  432.     const StyleSet<ParagraphStyle>& paragraphStyles()   { return docParagraphStyles; }
  433.     bool isDefaultStyle( const ParagraphStyle& p ) const { return docParagraphStyles.isDefault(p); }
  434.     bool isDefaultStyle( const CharStyle& c ) const { return docCharStyles.isDefault(c); }
  435. //     bool isDefaultStyle( LineStyle& l ) const { return MLineStyles......; }
  436.  
  437.     void getNamedResources(ResourceCollection& lists) const;
  438.     void replaceNamedResources(ResourceCollection& newNames);    
  439.     
  440.     void redefineStyles(const StyleSet<ParagraphStyle>& newStyles, bool removeUnused=false);
  441.     /**
  442.      * @brief Remove any reference to old styles and replace with new name. This needs to be
  443.      *        called when a style was removed. New name may be "".
  444.      * @param newNameForOld a map which maps the name of any style to remove to a new stylename
  445.      */
  446.     void replaceStyles(const QMap<QString,QString>& newNameForOld);
  447.     /**
  448.      * @brief Insert styles from another document in this document.
  449.      *        
  450.      * @param fileName The path of the document we want to extract its styles
  451.      */
  452.     void loadStylesFromFile(QString fileName);
  453.     /**
  454.      * @brief Gather styles from another document.
  455.      *        
  456.      * @param fileName The path of the document we want to extract its styles
  457.      * @param tempStyles A pointer to a StyleSet which will be filled by paragraph styles
  458.      * @param tempCharStyles A pointer to a StyleSet which will be filled by character styles
  459.      * @param tempLineStyles A map which will be filled by line styles
  460.      */
  461.     void loadStylesFromFile(QString fileName, StyleSet<ParagraphStyle> *tempStyles,
  462.                                               StyleSet<CharStyle> *tempCharStyles,
  463.                                               QMap<QString, multiLine> *tempLineStyles);
  464.  
  465.     const CharStyle& charStyle(QString name) { return docCharStyles.get(name); }
  466.     const StyleSet<CharStyle>& charStyles()  { return docCharStyles; }
  467.     void redefineCharStyles(const StyleSet<CharStyle>& newStyles, bool removeUnused=false);
  468.     /**
  469.      * @brief Remove any reference to old styles and replace with new name. This needs to be
  470.      *        called when a style was removed. New name may be "".
  471.      * @param newNameForOld a map which maps the name of any style to remove to a new stylename
  472.      */
  473.     void replaceCharStyles(const QMap<QString,QString>& newNameForOld);
  474.  
  475.     /**
  476.      * @brief Should guides be locked or not
  477.      * @param isLocked If true guides on pages cannot be moved if false they
  478.      * can be dragged to new positions.
  479.      * @author Riku Leino
  480.      */
  481.     void lockGuides(bool isLocked);
  482.     /**
  483.      * @brief Method used when an undo/redo is requested.
  484.      * @param state State describing the action that is wanted to be undone/redone
  485.      * @param isUndo If true undo is wanted else if false redo.
  486.      * @author Riku Leino
  487.      */
  488.     void restore(UndoState* state, bool isUndo);
  489.     /**
  490.      * @brief Sets the name of the document
  491.      * @param name Name for the document
  492.      * @author Riku Leino
  493.      */
  494.     void setName(const QString& name);
  495.     /*!
  496.      * @brief Returns a stringlist of the item attributes within the document
  497.      */
  498.     QStringList getItemAttributeNames();
  499.  
  500.     bool AddFont(QString name, int fsize = 10);
  501.     /*!
  502.      * @brief TODO: Reorganise the fonts.. how? Moved from scribus.cpp
  503.      * CB: almost the same as getUsedFonts???
  504.      */
  505.     QMap<QString,int> reorganiseFonts();
  506.     /*!
  507.      * @brief Returns a qmap of the fonts and  their glyphs used within the document
  508.      */
  509.     void getUsedFonts(QMap<QString,QMap<uint, FPointArray> > &Really);
  510.     void checkItemForFonts(PageItem *it, QMap<QString, QMap<uint, FPointArray> > & Really, uint lc);
  511.  
  512.     /*!
  513.      * @brief Replace line style colors
  514.      */
  515.     void replaceLineStyleColors(const QMap<QString, QString>& colorMap);
  516.     /*!
  517.     * @brief Builds a qmap of the colours used within the document
  518.     */
  519.     void getUsedColors(ColorList &colorsToUse, bool spot = false);
  520.     /*!
  521.     * @brief Return if a specific color is used by line styles
  522.     */
  523.     bool lineStylesUseColor(const QString& colorName);
  524.     /*!
  525.     * @brief Set the patterns for a document
  526.     */
  527.     bool addPattern(QString &name, ScPattern& pattern);
  528.     void setPatterns(QMap<QString, ScPattern> &patterns);
  529.     /*!
  530.     * @brief Builds a QStringList of the patterns used within the document
  531.     */
  532.     QStringList getUsedPatterns();
  533.     QStringList getUsedPatternsSelection(Selection* customSelection);
  534.     QStringList getUsedPatternsHelper(QString pattern, QStringList &results);
  535.     /**
  536.      * @brief Set and get the document's unit index
  537.      */
  538.     void setUnitIndex(const int);
  539.     int unitIndex() const;
  540.     double unitRatio() const;
  541.     /**
  542.      * @brief Apply a master page
  543.      */
  544.     bool applyMasterPage(const QString& pageName, const int pageNumber);
  545.     /**
  546.      * @brief Undo function for applying a master page
  547.      */
  548.     void restoreMasterPageApplying(SimpleState *state, bool isUndo);
  549.     void restorePageCopy(SimpleState *state, bool isUndo);
  550.     /**
  551.      * @brief Undo function for grouping/ungrouping
  552.      */
  553.     void restoreGrouping(SimpleState *state, bool isUndo);
  554.     void restoreUngrouping(SimpleState *state, bool isUndo);
  555.     /**
  556.      * @brief Save function
  557.      */
  558.     bool save(const QString& fileName, QString* savedFile = NULL);
  559.     /**
  560.      * @brief Set the page margins. Current code uses current page only, also provide a (currently, TODO) option for this.
  561.      */
  562.     bool changePageMargins(const double initialTop, const double initialBottom, const double initialLeft, const double initialRight, const double initialHeight, const double initialWidth, const double Height, const double width, const int orientation, const QString& pageSize, const int pageNumber=-1, const int pageType = 0);
  563.     /**
  564.      * @brief Recalculate the colors after CMS settings change. Update the items in the doc accordingly.
  565.      */
  566.      void recalculateColors();
  567.     /**
  568.      * @brief Sets up the ScText defaults from the document
  569.      */
  570.     void setScTextDefaultsFromDoc(ScText *);
  571.     /**
  572.      * @brief Copies a normal page to be a master pages
  573.      */
  574.     bool copyPageToMasterPage(const int, const int, const int, const QString&, bool);
  575.     /**
  576.      * @brief Paste an item to the document.
  577.      * The bulk of a paste item process runs here for want of a better place, but its a better place
  578.      * than the view where it used to be. 
  579.      * TODO Once the pageitem restructure is done, this is probably unnecessary but it removes the 
  580.      * unnecessary part from the view for now which is overloaded with non ScrollView code.
  581.      */
  582.     //TODO: void PasteItem(struct CopyPasteBuffer *Buffer, bool loading, bool drag = false);
  583.     
  584.     /**
  585.      * @brief Add an Item to the document.
  586.      * A simple function to create an item of a defined type and add it to the document
  587.      * Will need extensive rewriting once we have various classes of PageItems, at a guess.
  588.      *
  589.      * @param itemFinalised Used to handle item creation for undo while the user is still dragging.
  590.      * @return Number of created item, -1 on failure.
  591.     \param itemType type
  592.     \param frameType frame type
  593.     \param x X pos
  594.     \param y Y pos
  595.     \param b width
  596.     \param h height
  597.     \param w ?
  598.     \param fill fill color name
  599.     \param outline outline color name
  600.     */
  601.     int itemAdd(const PageItem::ItemType itemType, const PageItem::ItemFrameType frameType, const double x, const double y, const double b, const double h, const double w, const QString& fill, const QString& outline, const bool itemFinalised);
  602.  
  603.     /** Add an item to the page based on the x/y position. Item will be fitted to the closest guides/margins */
  604.     int itemAddArea(const PageItem::ItemType itemType, const PageItem::ItemFrameType frameType, const double x, const double y, const double w, const QString& fill, const QString& outline, const bool itemFinalised);
  605.     
  606.     /**
  607.      * @brief Allow the user to create a frame easily with some simple placement and sizing options
  608.      * @param iafData a InsertAFrameData structure with params
  609.      * @return int item id? FIXME
  610.      */
  611.     int itemAddUserFrame(InsertAFrameData &iafData);
  612.  
  613.     /**
  614.      * @brief Commit item creation when a user has click-drag created an item
  615.      * Only called from ScribusView. Note the undo target is the page, so the undo code remains their for now.
  616.      * @return If an item was committed and the view must emit its signal, which needs removing from here, TODO.
  617.      */
  618.     bool itemAddCommit(const int itemNumber);
  619.     
  620.     /**
  621.      * @brief Finalise item creation. Simply split off code from itemAdd
  622.      * Only to be called from itemAdd()
  623.      */
  624.     void itemAddDetails(const PageItem::ItemType itemType, const PageItem::ItemFrameType frameType, const int itemNumber);
  625.  
  626.     uint getItemNrfromUniqueID(uint unique);
  627.     //itemDelete
  628.     //itemBlah...
  629.     
  630.     /**
  631.      * @brief Run this common frame item update code
  632.      */
  633.     void updateFrameItems();
  634.     /**
  635.      * @brief Renumbers the items into the order they are stored in in the lists.
  636.      * Utility function used in various places, basically handles keeping items numbered in the way
  637.      * they are layered. When layer is a property and not a fuction of storage, this should be removed.
  638.      * Depends on the Items pointer pointing to the correct item list (doc, master, etc).
  639.      * @sa updateFrameItems();
  640.      */
  641.     void renumberItemsInListOrder();
  642.     /**
  643.      * @brief Rebuild item lists taking into account layer order.
  644.      * Utility function used in various places, basically handles keeping items numbered in the way
  645.      * they are layered. When layer is a property and not a fuction of storage, this should be removed.
  646.      * @sa updateFrameItems();
  647.      */
  648.     void rebuildItemLists();
  649.     /**
  650.      * @brief Doc uses automatic text frames?
  651.      */
  652.     bool usesAutomaticTextFrames() const;
  653.     void setUsesAutomaticTextFrames(const bool);
  654.     
  655.     /**
  656.      * @brief Load images into an image frame, moved from the view
  657.      * @retval Return false on failure
  658.      */
  659.     bool LoadPict(QString fn, int ItNr, bool reload = false, bool showMsg = false);
  660.     /**
  661.      * 
  662.      * @param fn 
  663.      * @param pageItem 
  664.      * @param reload 
  665.      * @return 
  666.      */
  667.     bool loadPict(QString fn, PageItem *pageItem, bool reload = false, bool showMsg = false);
  668.     /**
  669.      * \brief Handle image with color profiles
  670.      * @param Pr profile
  671.        @param PrCMYK cmyk profile
  672.        @param dia optional progress widget
  673.      */
  674.     void RecalcPictures(ProfilesL *Pr, ProfilesL *PrCMYK, QProgressBar *dia = 0);
  675.     /**
  676.      * @brief Find the minX,MinY and maxX,maxY for the canvas required for the doc
  677.      */
  678.     void canvasMinMax(FPoint&, FPoint&);
  679.     
  680.     int OnPage(double x2, double  y2);
  681.     int OnPage(PageItem *currItem);
  682.     void GroupOnPage(PageItem *currItem);
  683.     //void reformPages(double& maxX, double& maxY, bool moveObjects = true);
  684.     void reformPages(bool moveObjects = true);
  685.     
  686.     /**
  687.      * @brief Return the x or y offset for a page on the canvas
  688.      * @retval double containing the offset. Returns -1.0 if page not in Pages list (as -ve is not possible).
  689.      * Mostly saves bringing in extra includes into files that already have scribusdoc.h
  690.      */
  691.     double getXOffsetForPage(const int);
  692.     double getYOffsetForPage(const int);
  693.     void getBleeds(int pageNumber, MarginStruct& bleedData);
  694.     void getBleeds(const Page* page, MarginStruct& bleedData);
  695.     void getBleeds(const Page* page, const MarginStruct& baseValues, MarginStruct& bleedData);
  696.     
  697.     /**
  698.      * @brief Item type conversion functions
  699.      */
  700.     PageItem* convertItemTo(PageItem *currItem, PageItem::ItemType newType, PageItem* secondaryItem=NULL);
  701.     
  702.     /**
  703.      * @brief The page number of the current page
  704.      */
  705.     int currentPageNumber();
  706.     
  707.     /**
  708.      * @brief Return true iff the passed name is not used by any existing PageItem
  709.      *        in the same document as this PageItem.
  710.      * @author Craig Ringer
  711.      ** CB Moved from PageItem
  712.      */
  713.     bool itemNameExists(const QString itemName);
  714.     
  715.     /**
  716.      * @brief Set the doc into Master page mode
  717.      * Do we need to return if the move to master page mode was successful?
  718.      */
  719.     void setMasterPageMode(bool);
  720.  
  721.     /*** Is the document in master page mode? */
  722.     bool masterPageMode() const { return m_masterPageMode; }
  723.     
  724.     /**
  725.      * @brief Add a section to the document sections list
  726.      * Set number to -1 to add in the default section if the map is empty
  727.      */
  728.     void addSection(const int number=0, const QString& name=QString::null, const uint fromindex=0, const uint toindex=0, const  DocumentSectionType type=Type_1_2_3, const uint sectionstartindex=0, const bool reversed=false, const bool active=true);
  729.     /**
  730.      * @brief Delete a section from the document sections list
  731.      */
  732.     bool deleteSection(const uint);
  733.     /**
  734.      * @brief Gets the page number to be printed based on the section it is in.
  735.      * Returns QString::null on failure to find the pageIndex
  736.      */
  737.     const QString getSectionPageNumberForPageIndex(const uint) const;
  738.     /**
  739.      * @brief Gets the key of the sections map based on the section the page index is in.
  740.      * Returns -1 on failure to find the pageIndex
  741.      */
  742.     int getSectionKeyForPageIndex(const uint pageIndex) const;
  743.     /**
  744.      *
  745.      *
  746.      */
  747.     void updateSectionPageNumbersToPages();
  748.     /**
  749.      * 
  750.      * @param otherPageIndex 
  751.      * @param location 
  752.      * @param count 
  753.      */
  754.     void addPageToSection(const uint otherPageIndex, const uint location, const uint count=1);
  755.     /**
  756.      * 
  757.      * @param pageIndex 
  758.      */
  759.     void removePageFromSection(const uint pageIndex);
  760.     /**
  761.      * 
  762.      */
  763.     void setFirstSectionFromFirstPageNumber();
  764.     /**
  765.      * @brief Update the fill and line QColors for all items in the doc
  766.      */
  767.     void updateAllItemQColors();
  768.     //! @brief Some internal align tools
  769.     typedef enum {alignFirst, alignLast, alignPage, alignMargins, alignGuide, alignSelection } AlignTo;
  770.     void buildAlignItemList(Selection* customSelection=0);
  771.     bool startAlign();
  772.     void endAlign();
  773.     /**
  774.      * \brief Insert a color into the documents color list
  775.      * @param nam Name of the colour
  776.      * @param c Cyan component
  777.      * @param m Magenta component
  778.      * @param y Yellow component
  779.      * @param k Black component
  780.      */
  781.     void insertColor(QString nam, double c, double m, double y, double k);
  782.     
  783.     QMap<QString, double>& constants() { return m_constants; }
  784.     /**
  785.      * \brief Get the location of the page on the canvas, ie, left, middle, or right
  786.      * Does not give information about middle left, etc.
  787.      * @param pageIndex Index of page to find location for
  788.      * @return LeftPage, MiddlePage, RightPage, enum from pagestructs.h
  789.      */
  790.     PageLocation locationOfPage(int pageIndex) const;
  791.     /**
  792.      * \brief Get the column of the page on the canvas, ie, left, middle, or right
  793.      * @param pageIndex Index of page to find location for
  794.      * @return int of 0,1,2,3
  795.      */
  796.     int columnOfPage(int pageIndex) const;
  797.     
  798.     bool sendItemSelectionToBack();
  799.     bool bringItemSelectionToFront();
  800.  
  801.     void itemSelection_GroupObjects  (bool changeLock, bool lock, Selection* customSelection=0);
  802.     void itemSelection_UnGroupObjects(Selection* customSelection=0);
  803.     void itemSelection_convertItemsTo(const PageItem::ItemType newType, Selection* restoredSelection=0, Selection* customSelection=0);
  804.  
  805.     void itemSelection_ApplyParagraphStyle(const ParagraphStyle & newstyle, Selection* customSelection=0, bool rmDirectFormatting = false);
  806.     void itemSelection_SetParagraphStyle(const ParagraphStyle & newstyle, Selection* customSelection=0);
  807.     void itemSelection_ApplyCharStyle(const CharStyle & newstyle, Selection* customSelection=0);
  808.     void itemSelection_SetCharStyle(const CharStyle & newstyle, Selection* customSelection=0);
  809.     void itemSelection_EraseParagraphStyle(Selection* customSelection=0);
  810.     void itemSelection_EraseCharStyle(Selection* customSelection=0);
  811.  
  812.     void itemSelection_SetNamedParagraphStyle(const QString & name, Selection* customSelection=0);
  813.     void itemSelection_SetNamedCharStyle(const QString & name, Selection* customSelection=0);
  814.     void itemSelection_SetNamedLineStyle(const QString & name, Selection* customSelection=0);
  815.  
  816.     void itemSelection_SetLineWidth(double w);
  817.     void itemSelection_SetLineArt(Qt::PenStyle w);
  818.     void itemSelection_SetLineJoin(Qt::PenJoinStyle w);
  819.     void itemSelection_SetLineEnd(Qt::PenCapStyle w);
  820.     void itemSelection_SetAlignment(int w, Selection* customSelection=0);
  821.     void itemSelection_SetLineSpacing(double w, Selection* customSelection=0);
  822.     void itemSelection_SetLineSpacingMode(int w, Selection* customSelection=0);
  823.     //void ChLocalXY(double x, double y);
  824.     //void ChLocalSc(double x, double y);
  825.     void itemSelection_SetFont(QString fon, Selection* customSelection=0);
  826.     void itemSelection_SetFillColor(QString farbe, Selection* customSelection=0);
  827.     void itemSelection_SetFillShade(int sha, Selection* customSelection=0);
  828.     void itemSelection_SetStrokeColor(QString farbe, Selection* customSelection=0);
  829.     void itemSelection_SetStrokeShade(int sha, Selection* customSelection=0);
  830.     void itemSelection_SetScaleV(int, Selection* customSelection=0);
  831.     void itemSelection_SetScaleH(int, Selection* customSelection=0);
  832.     void itemSelection_SetBaselineOffset(int, Selection* customSelection=0);
  833.     void itemSelection_SetOutlineWidth(int, Selection* customSelection=0);
  834.     void itemSelection_SetShadowOffsets(int shx, int shy, Selection* customSelection=0);
  835.     void itemSelection_SetUnderline(int pos, int wid, Selection* customSelection=0);
  836.     void itemSelection_SetStrikethru(int pos, int wid, Selection* customSelection=0);
  837.     void itemSelection_SetEffects(int s, Selection* customSelection=0);
  838.     void itemSelection_SetOpticalMargins(int i, Selection* customSelection=0);
  839.     void itemSelection_resetOpticalMargins(Selection* customSelection=0);
  840.     void itemSelection_SetColorProfile(const QString& profileName, Selection* customSelection=0);
  841.     void itemSelection_SetRenderIntent(int intentIndex, Selection* customSelection=0);
  842.     
  843. //    void chAbStyle(PageItem *currItem, int s);
  844.  
  845.     void itemSelection_SetTracking(int us, Selection* customSelection=0);
  846.     void itemSelection_SetFontSize(int size, Selection* customSelection=0);
  847.     //void FlipImageH();
  848.     //void FlipImageV();
  849.     void MirrorPolyH(PageItem *currItem);
  850.     void MirrorPolyV(PageItem *currItem);
  851.     
  852.     void setRedrawBounding(PageItem *currItem);
  853.     void adjustCanvas(FPoint minPos, FPoint maxPos, bool absolute = false);
  854.     void recalcPicturesRes(bool applyNewRes = false);
  855.     void connectDocSignals();
  856.     void removeLayer(int l, bool dl = false); //FIXME: Make protected once scripter function no longer uses this directly
  857.     /*! \brief We call changed() whenever the document needs to know it has been changed.
  858.      *  If the document is the primary document in a main window, it will signal to enable/disable
  859.      * certain operations.
  860.      */
  861.     void changed();
  862.     /*! \brief Get pointer to the current page
  863.     \retval Page* current page object */
  864.     Page* currentPage();
  865.     /*! \brief Set new current page
  866.     \param newPage New current page */
  867.     void setCurrentPage(Page *newPage);
  868.     bool hasGUI() const {return m_hasGUI;}
  869.     /*! \brief Apply grid to a QPoint, from ScribusView */
  870.     QPoint ApplyGrid(const QPoint& in);
  871.     /*! \brief Apply grid to an FPoint, from ScribusView */
  872.     FPoint ApplyGridF(const FPoint& in);
  873.     /*! \brief Does this doc have any TOC setups and potentially a TOC to generate */
  874.     bool hasTOCSetup() { return !docToCSetups.empty(); }
  875.     //! \brief Get the closest guide to the given point
  876.     void getClosestGuides(double xin, double yin, double *xout, double *yout, int *GxM, int *GyM);
  877.     //! \brief Snap an item to the guides
  878.     void SnapToGuides(PageItem *currItem);
  879.     bool ApplyGuides(double *x, double *y);
  880.     bool MoveItem(double newX, double newY, PageItem* ite, bool fromMP = false);
  881.     void RotateItem(double win, int ite);
  882.     void RotateItem(double win, PageItem *currItem);
  883.     void MoveRotated(PageItem *currItem, FPoint npv, bool fromMP = false);
  884.     bool SizeItem(double newX, double newY, int ite, bool fromMP = false, bool DoUpdateClip = true, bool redraw = true);
  885.     bool SizeItem(double newX, double newY, PageItem *pi, bool fromMP = false, bool DoUpdateClip = true, bool redraw = true);
  886.     bool MoveSizeItem(FPoint newX, FPoint newY, int ite, bool fromMP = false, bool constrainRotation=false);
  887.     void AdjustItemSize(PageItem *currItem);
  888.     void moveGroup(double x, double y, bool fromMP = false, Selection* customSelection = 0);
  889.     void rotateGroup(double angle, FPoint RCenter);
  890.     void scaleGroup(double scx, double scy, bool scaleText=true, Selection* customSelection = 0);
  891.     //! \brief Get a list of frames of certain type
  892.     QMap<PageItem*, QString> getDocItemNames(PageItem::ItemType itemType);
  893.  
  894.     //! \brief Fonctions which avoid doc updater and update manager to send too much
  895.     // unncessary signals when doing updates on multiple items
  896.     void beginUpdate();
  897.     void endUpdate();
  898.     
  899. protected:
  900.     void addSymbols();
  901.     bool m_hasGUI;
  902.     ApplicationPrefs& prefsData;
  903.     UndoManager * const undoManager;
  904.     bool loading;
  905.     bool modified;
  906.     int ActiveLayer;
  907.     int docUnitIndex;
  908.     double docUnitRatio;
  909.     bool automaticTextFrames; // Flag for automatic Textframes
  910.     bool m_masterPageMode;
  911.     QMap<QString, double> m_constants;
  912.     ScribusMainWindow* m_ScMW;
  913.     ScribusView* m_View;
  914.     ScGuardedObject<ScribusDoc> m_guardedObject;
  915.     
  916. public: // Public attributes
  917.     bool is12doc; //public for now, it will be removed later
  918.     int NrItems;
  919.     int First;
  920.     int Last;
  921.     int viewCount;
  922.     int viewID;
  923.     bool SnapGuides;
  924.     bool GuideLock;
  925.     /** \brief Scratch space around Pages */
  926.     MarginStruct scratch;
  927.     double GapHorizontal;
  928.     double GapVertical;
  929. //     double ScratchLeft;
  930. //     double ScratchRight;
  931. //     double ScratchTop;
  932. //     double ScratchBottom;
  933.     /** \brief Minimum and Maximum Points of Document */
  934.     FPoint minCanvasCoordinate;
  935.     FPoint maxCanvasCoordinate;
  936.     double rulerXoffset;
  937.     double rulerYoffset;
  938.     /** \brief List of Pages */
  939.     QList<Page*>* Pages;
  940.     /** \brief List of Master Pages */
  941.     QList<Page*> MasterPages;
  942.     /** \brief List of Document Pages */
  943.     QList<Page*> DocPages;
  944.     /** \brief Mapping Master Page Name to Master Page numbers */
  945.     QMap<QString,int> MasterNames;
  946.     /** \brief List of Objects */
  947.     QList<PageItem*>* Items;
  948.     QList<PageItem*> MasterItems;
  949.     QList<PageItem*> DocItems;
  950.     QList<PageItem*> FrameItems;
  951.     Selection* const m_Selection;
  952.     /** \brief Pagewidth  */
  953.     double pageWidth;
  954.     /** \brief Pageheight */
  955.     double pageHeight;
  956.     /* Number of Pages */
  957.     // int pageCount; Disabled CR no longer required
  958.     /** \brief Margins */
  959.     MarginStruct pageMargins;
  960.     int marginPreset;
  961.     QList<PageSet> pageSets;
  962.     MarginStruct bleeds;
  963. //     double BleedTop;
  964. //     double BleedLeft;
  965. //     double BleedRight;
  966. //     double BleedBottom;
  967.     /** \brief Number of Columns */
  968.     double PageSp;
  969.     /** \brief Distance of Columns */
  970.     double PageSpa;
  971.     /** \brief current Pagelayout */
  972.     int currentPageLayout;
  973.     /** \brief Flag fuer Hoch- oder Querformat 0 = Hochformat */
  974.     int PageOri;
  975.     QString m_pageSize;
  976.     /** \brief Erste Seitennummer im Dokument */
  977.     int FirstPnum;
  978.     /** \brief Flag fuer Rasterbenutzung */
  979.     bool useRaster;
  980.     /** \brief Im Dokument benutzte Farben */
  981.     ColorList PageColors;
  982.     /** \brief InfoStrings fuer das aktuelle Dokument */
  983.     DocumentInformation documentInfo;
  984.     int appMode;
  985.     int SubMode;
  986.     double *ShapeValues;
  987.     int ValCount;
  988.     QString DocName;
  989.     QMap<QString,int> UsedFonts;
  990.     SCFonts * const AllFonts;
  991.     QList<AlignObjs> AObjects;
  992.     QColor papColor;
  993.     int CurrentSel;
  994.     ParagraphStyle currentStyle;
  995.  
  996.     NodeEditContext nodeEdit;
  997.  
  998.     typoPrefs typographicSettings;
  999.     guidesPrefs guidesSettings;
  1000.     toolPrefs toolSettings;
  1001.     QMap<QString, checkerPrefs> checkerProfiles;
  1002.     QString curCheckProfile;
  1003.     /** \brief Letztes Element fuer AutoTextrahmen */
  1004.     PageItem *LastAuto;
  1005.     /** \brief Erstes Element fuer AutoTextrahmen */
  1006.     PageItem *FirstAuto;
  1007.     bool DragP;
  1008.     bool leaveDrag;
  1009.     PageItem *DraggedElem;
  1010.     PageItem *ElemToLink;
  1011.     QList<uint> DragElements;
  1012. private:
  1013.     StyleSet<ParagraphStyle> docParagraphStyles;
  1014.     StyleSet<CharStyle> docCharStyles;
  1015. public:
  1016.     ScLayers Layers;
  1017.     bool marginColored;
  1018.     int GroupCounter;
  1019.     CMSData CMSSettings;
  1020.     cmsHPROFILE DocInputImageRGBProf;
  1021.     cmsHPROFILE DocInputImageCMYKProf;
  1022.     cmsHPROFILE DocInputRGBProf;
  1023.     cmsHPROFILE DocInputCMYKProf;
  1024.     cmsHPROFILE DocOutputProf;
  1025.     cmsHPROFILE DocPrinterProf;
  1026.     cmsHTRANSFORM stdTransRGBMon;
  1027.     cmsHTRANSFORM stdTransCMYKMon;
  1028.     cmsHTRANSFORM stdProof;
  1029.     cmsHTRANSFORM stdTransImg;
  1030.     cmsHTRANSFORM stdProofImg;
  1031.     cmsHTRANSFORM stdProofImgCMYK;
  1032.     cmsHTRANSFORM stdTransCMYK;
  1033.     cmsHTRANSFORM stdProofCMYK;
  1034.     cmsHTRANSFORM stdTransRGB;
  1035.     cmsHTRANSFORM stdProofGC;
  1036.     cmsHTRANSFORM stdProofCMYKGC;
  1037.     bool BlackPoint;
  1038.     bool SoftProofing;
  1039.     bool Gamut;
  1040.     int  IntentColors;
  1041.     int  IntentImages;
  1042.     bool HasCMS;
  1043.     QMap<QString,QString> JavaScripts;
  1044.     int TotalItems;
  1045.     int MinWordLen;
  1046.     int HyCount;
  1047.     QString Language;
  1048.     bool Automatic;
  1049.     bool AutoCheck;
  1050.     PDFOptions PDF_Options;
  1051.     PrintOptions Print_Options;
  1052.     bool RePos;
  1053.     struct BookMa {
  1054.                     QString Title;
  1055.                     QString Text;
  1056.                     QString Aktion;
  1057.                     PageItem *PageObject;
  1058.                     int Parent;
  1059.                     int ItemNr;
  1060.                     int First;
  1061.                     int Last;
  1062.                     int Prev;
  1063.                     int Next;
  1064.                     };
  1065.     QList<BookMa> BookMarks;
  1066.     bool OldBM;
  1067.     bool hasName;
  1068.     int RotMode;
  1069.     bool AutoSave;
  1070.     int AutoSaveTime;
  1071.     QTimer * const autoSaveTimer;
  1072.     QMap<QString,multiLine> MLineStyles;
  1073.     QList<ArrowDesc> arrowStyles;
  1074.     QMap<QString, ScPattern> docPatterns;
  1075.     QWidget* WinHan;
  1076.     bool DoDrawing;
  1077.     struct OpenNodesList
  1078.     {
  1079.         int type;
  1080.         Page *page;
  1081.         PageItem *item;
  1082.     };
  1083.     QList<OpenNodesList> OpenNodes;
  1084.     QTimer *CurTimer;
  1085.     QMap<int, errorCodes> docLayerErrors;
  1086.     QMap<int, errorCodes> docItemErrors;
  1087.     QMap<int, errorCodes> masterItemErrors;
  1088.     //Attributes to be applied to frames
  1089.     ObjAttrVector docItemAttributes;
  1090.     ToCSetupVector docToCSetups;
  1091.     DocumentSectionMap sections;
  1092.     FPointArray symReturn;
  1093.     FPointArray symNewLine;
  1094.     FPointArray symTab;
  1095.     FPointArray symNonBreak;
  1096.     FPointArray symNewCol;
  1097.     FPointArray symNewFrame;
  1098.     
  1099.     Hyphenator * docHyphenator;
  1100. private:
  1101.     UndoTransaction* m_itemCreationTransaction;
  1102.     UndoTransaction* m_alignTransaction;
  1103.  
  1104.     Page* m_currentPage;
  1105.     UpdateManager m_updateManager;
  1106.     MassObservable<PageItem*> m_itemsChanged;
  1107.     MassObservable<Page*> m_pagesChanged;
  1108.     MassObservable<QRectF> m_regionsChanged;
  1109.     DocUpdater* m_docUpdater;
  1110.     
  1111. signals:
  1112.     //Lets make our doc talk to our GUI rather than confusing all our normal stuff
  1113.     /**
  1114.      * @brief Let the document tell whatever is listening that it has changed
  1115.      */
  1116.     void docChanged();
  1117.     void updateContents();
  1118.     void updateContents(const QRect &r);
  1119.     void refreshItem(PageItem *);
  1120.     void canvasAdjusted(double width, double height, double dX, double dY);
  1121.     void firstSelectedItemType(int);
  1122.     void setApplicationMode(int);
  1123.     /**
  1124.      * @brief A signal for when the outline palette needs to rebuild itself
  1125.      * Emit when:
  1126.      * - An item is created or deleted
  1127.      * - An item changes page
  1128.      * - An page is created or deleted
  1129.      * - Some items are grouped or a group is ungrouped
  1130.      * This also applies to Master Pages
  1131.      */
  1132.     void signalRebuildOutLinePalette();
  1133.     //! Temporary signal for SizeItem
  1134.     void widthAndHeight(double, double);
  1135.     
  1136. public slots:
  1137.     void itemSelection_ToggleLock();
  1138.     void itemSelection_ToggleSizeLock();
  1139.     void itemSelection_ToggleImageShown();
  1140.     void itemSelection_TogglePrintEnabled();
  1141.     void itemSelection_ChangePreviewResolution(int id);
  1142.  
  1143.     /*! \brief Change display quality of all images in document.
  1144.     \author  OssiLehtinen
  1145.     */
  1146.     void allItems_ChangePreviewResolution(int id);
  1147.  
  1148.     void itemSelection_ClearItem(Selection* customSelection=0);
  1149.     //! Delete the items in the current selection. When force is true, we do not warn the user and make SE happy too. Force is used from @sa Page::restorePageItemCreation
  1150.     void itemSelection_DeleteItem(Selection* customSelection=0, bool forceDeletion=false);
  1151.     void itemSelection_SetItemFillTransparency(double t);
  1152.     void itemSelection_SetItemLineTransparency(double t);
  1153.     void itemSelection_SetItemFillBlend(int t);
  1154.     void itemSelection_SetItemLineBlend(int t);
  1155.     void itemSelection_SetLineGradient(VGradient& newGradient, Selection* customSelection=0);
  1156.     void itemSelection_SetFillGradient(VGradient& newGradient, Selection* customSelection=0);
  1157.     void itemSelection_SetOverprint(bool overprint, Selection* customSelection=0);
  1158.     void itemSelection_ApplyImageEffects(ScImageEffectList& newEffectList, Selection* customSelection=0);
  1159.     void itemSelection_FlipH();
  1160.     void itemSelection_FlipV();
  1161.     void itemSelection_DoHyphenate();
  1162.     void itemSelection_DoDeHyphenate();
  1163.     void itemSelection_SendToLayer(int layerNumber);
  1164.     void itemSelection_SetImageOffset(double x, double y, Selection* customSelection=0);
  1165.     void itemSelection_SetImageScale(double x, double y, Selection* customSelection=0);
  1166.     void itemSelection_SetImageScaleAndOffset(double ox, double oy, double sx, double sy, Selection* customSelection=0);
  1167.     void itemSelection_AlignLeftOut(AlignTo currAlignTo, double guidePosition);
  1168.     void itemSelection_AlignRightOut(AlignTo currAlignTo, double guidePosition);
  1169.     void itemSelection_AlignBottomIn(AlignTo currAlignTo, double guidePosition);
  1170.     void itemSelection_AlignRightIn(AlignTo currAlignTo, double guidePosition);
  1171.     void itemSelection_AlignBottomOut(AlignTo currAlignTo, double guidePosition);
  1172.     void itemSelection_AlignCenterHor(AlignTo currAlignTo, double guidePosition);
  1173.     void itemSelection_AlignLeftIn(AlignTo currAlignTo, double guidePosition);
  1174.     void itemSelection_AlignCenterVer(AlignTo currAlignTo, double guidePosition);
  1175.     void itemSelection_AlignTopOut(AlignTo currAlignTo, double guidePosition);
  1176.     void itemSelection_AlignTopIn(AlignTo currAlignTo, double guidePosition);
  1177.     void itemSelection_DistributeDistH(bool usingDistance=false, double distance=0.0);
  1178.     void itemSelection_DistributeAcrossPage(bool useMargins=false);
  1179.     void itemSelection_DistributeRight();
  1180.     void itemSelection_DistributeBottom();
  1181.     void itemSelection_DistributeCenterH();
  1182.     void itemSelection_DistributeDistV(bool usingDistance=false, double distance=0.0);
  1183.     void itemSelection_DistributeDownPage(bool useMargins=false);
  1184.     void itemSelection_DistributeLeft();
  1185.     void itemSelection_DistributeCenterV();
  1186.     void itemSelection_DistributeTop();
  1187.     void itemSelection_MultipleDuplicate(ItemMultipleDuplicateData&);
  1188.     void itemSelection_UniteItems(Selection* customSelection=0);
  1189.     void itemSelection_SplitItems(Selection* customSelection=0);
  1190.     /**
  1191.      * Adjust an image frame's size to fit the size of the image in it
  1192.      */
  1193.     void itemSelection_AdjustFrametoImageSize(Selection* customSelection=0);
  1194.     /**
  1195.      * Adjust an image size to fit the size of the frame
  1196.      */
  1197.     void itemSelection_AdjustImagetoFrameSize(Selection* customSelection=0);
  1198.     //! @brief startArrowID or endArrowID of -1 mean not applying a selection at this point.
  1199.     void itemSelection_ApplyArrowHead(int startArrowID=-1, int endArrowID=-1, Selection* customSelection=0);
  1200.  
  1201.     void itemSelection_SetItemPen(QString farbe);
  1202.     void itemSelection_SetItemPenShade(int sha);
  1203.     void itemSelection_SetItemBrush(QString farbe);
  1204.     void itemSelection_SetItemBrushShade(int sha);
  1205.     void itemSelection_SetItemGradFill(int typ);
  1206.     void itemSelection_SetItemPatternFill(QString pattern);
  1207.     void itemSelection_SetItemPatternProps(double scaleX, double scaleY, double offsetX, double offsetY, double rotation);
  1208.  
  1209.     void undoRedoBegin();
  1210.     void undoRedoDone();
  1211.  
  1212.     void updatePic();
  1213.     void updatePict(QString name);
  1214.     void updatePictDir(QString name);
  1215.     void removePict(QString name);
  1216. };
  1217.  
  1218. Q_DECLARE_METATYPE(ScribusDoc*);
  1219.  
  1220. #endif
  1221.